package week5;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Ex42 {
    public static void main(String[] args) throws IOException {
        BufferedReader read = new BufferedReader(new FileReader("E:\\javaprj\\javaclub\\src\\week5\\p042_words.txt"));
        String[] words = read.readLine().replace("\"","").split(",");
        int sum;
        int ans = 0;
        for (String str : words){
            sum = 0;
            for (int i = 0; i < str.length(); ++i){
                sum += str.charAt(i) - 'A' + 1;
            }
            if (Math.sqrt(1+8*sum) % 2 == 1)
                ans++;
        }
        System.out.println(ans);
    }
}
